package cn.bonoon.kernel.util;

import java.util.HashMap;
import java.util.Map;

public class Cached {
	private final static Object VALUE = new Object();
	private final Map<Object, Object> cached = new HashMap<Object, Object>();
	
	public boolean contains(Object key){
		return cached.put(key, VALUE) != null;
	}
	
	public boolean check(Object key){
		return cached.containsKey(key);
	}
	
	public void put(Object key){
		cached.put(key, VALUE);
	}
}
